package com.koron.standard.orderCard.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.koron.bean.base.Attachment;
import com.koron.standard.orderCard.bean.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderCardMapper extends BaseMapper<OrderCard> {

	Page<OrderCard> queryOrderCardPage(@Param("page") IPage<OrderCard> page,  @Param(Constants.WRAPPER) Wrapper<OrderCard> queryWrapper);

	List<OrderCard> queryOrderCard(@Param("orderCardQuery") OrderCardQuery orderCardQuery,@Param("typeIds") List<String> typeIds);

	String getLevelByType(@Param("typeId") String typeId);

	List<String> queryTypeByLevel(@Param("typeLevel") String typeLevel);

	List<OrderCard> queryOrderCardByTypeIds(@Param("typeIds") List<String> typeIds);

	OrderCard getOrderCardById(@Param("id") String id, @Param("code") String code);

	List<OrderCard> queryByEquipmentType(@Param("equipmentTypeId") String equipmentTypeId,@Param("cardName") String cardName, @Param("status") String status);

	List<StepBean> queryStepsByOrderCardId(@Param("id") String id);

	List<Attachment> queryAttachmentByIds(@Param("card_step_ids") List<String> card_step_ids);

	Integer saveOrUpdateOrderCard(@Param("orderCard") OrderCard orderCard);

	Integer saveOrUpdateStepList(List<StepBean> list);

	Integer saveOrUpdateToolList(@Param("tools")List<ToolConnectBean> tools);

	Integer deleteOrderCardById(@Param("orderCardId") String orderCardId);

	Integer deleteToolById(@Param("toolIds") List<String> toolIds);

	Integer deleteStepById(@Param("stepIds") List<String> stepIds);

	String getEquipmentTypeById(@Param("id") String id);

	List<OrderCardFile> getOrderCardFileListByBusinessIds(@Param("ids") List<String> ids);

	Integer deleteSingleFileById(@Param("id") String id);

	Integer deleteFilesById(@Param("ids") List<String> ids);

	Integer saveOrUpdateFiles(@Param("files") List<OrderCardFile> files);
}
